package my.study.designpattern.factorymethod;


public class Main {
	/**
	 * 工厂方法模式中，核心工厂类不在需要负责所有的产品的创建，
	 * 而是将具体的产品创建交给具体的工厂类
	 * @param args
	 */
	public static void main(String[] args) {
			FruitFactory appleFactory = new AppleFactory();
			Fruit apple = appleFactory.createFruit();
			apple.plant();
			FruitFactory grapeFactory = new GrapeFactory();
			Fruit grape =  grapeFactory.createFruit();
			grape.grow();
	}
}
